package com.bidianying.task;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import com.bidianying.service.MaizuoService;

@Component 
public class MaizuoTask {
	
	@Autowired
	private MaizuoService maizuoService;
	
	//初始化城市信息
	@Scheduled(cron = "0 56 10 * * ?") 
    public void job1() {
		System.out.println("maizuo定时器job2---start---");
//		maizuoService.saveMaizuoCityInfo();
		System.out.println("maizuo定时器job2---end---");
	}
	
	//初始化卖座网的电影id
	@Scheduled(cron = "0 38 14 * * ?") 
    public void job2() {
		System.out.println("maizuo定时器job1---start---");
		maizuoService.saveMovieInfo();
		System.out.println("maizuo定时器job1---end---");
	}
	//初始化卖座网的影院
	@Scheduled(cron = "0 24 10 * * ?") 
    public void job3() {
		System.out.println("maizuo定时器job3---start---");
		//maizuoService.saveMaizuoCinemaInfo();
		System.out.println("maizuo定时器job3---end---");
	}
	//将卖座影院信息存入redis
	//初始化卖座网的影院
	@Scheduled(cron = "0 24 10 * * ?") 
    public void job4() {
		System.out.println("maizuo定时器job3---start---");
		//maizuoService.saveMaizuoCinemaInfo();
		System.out.println("maizuo定时器job3---end---");
	}
}
